/*
    线上
*/
var baseHead = "http://122.9.133.100:8025/elevator/";
/*
    秦浩南
*/
// var baseHead = "http://192.168.1.28:8025/elevator/";

/*
    任会勇
*/
// var baseHead = "http://192.168.2.65:8025/elevator/";
// var baseHead = "http://rhyme.nat300.top/elevator/";
//  var baseHead = "http://localhost:8025/elevator/";

/*
    wy
*/
// var baseHead = "http://192.168.1.29:8025/elevator/";
// jQuery.support.cors = true;

function sendRequest(request, success, error) {
    $.ajax({
        headers: {
            "token": $token,
        },
        url: baseHead + request.url,
        // url: request.url,
        data: request.data || {},
        contentType: request.contentType || 'application/x-www-form-urlencoded; charset=UTF-8',
        method: request.method || 'GET',
        async: request.async || true,
        // timeout: request.timeout || 30000,
        success: function (data) {
            success && success(data);
        },
        error: function (data) {
            error && error(data);
            error || console.error(data.responseJSON);
            // error || mui.alert("请稍后再试!")
        }

    });
}
